FROM harbor.tegical.world/docker.io/library/node:22.3.0-alpine
MAINTAINER charzhou

COPY ./ /app
WORKDIR /app

# 添加腾讯云内网镜像库
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.cloud.tencent.com/g' /etc/apk/repositories

# 处理时区问题
RUN apk add tzdata
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo "Asia/Shanghai" > /etc/timezone

# 启用PNPM
ENV COREPACK_NPM_REGISTRY=https://mirrors.cloud.tencent.com/npm
RUN corepack enable
RUN corepack prepare pnpm@latest --activate
RUN pnpm config set store-dir /root/.pnpm-store

# 安装依赖
RUN pnpm install --production --registry=https://mirrors.cloud.tencent.com/npm/

CMD ["node","src/bin/www"]
